package sbe.sonar.client.database;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the ModulesByApplication database table.
 * 
 */
@Embeddable
public class ModulesByApplicationPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private String idApplication;
	private String idModule;

	public ModulesByApplicationPK() {
	}

	@Column(insertable=false, updatable=false)
	public String getIdApplication() {
		return this.idApplication;
	}
	public void setIdApplication(String idApplication) {
		this.idApplication = idApplication;
	}

	@Column(insertable=false, updatable=false)
	public String getIdModule() {
		return this.idModule;
	}
	public void setIdModule(String idModule) {
		this.idModule = idModule;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof ModulesByApplicationPK)) {
			return false;
		}
		ModulesByApplicationPK castOther = (ModulesByApplicationPK)other;
		return 
			this.idApplication.equals(castOther.idApplication)
			&& this.idModule.equals(castOther.idModule);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.idApplication.hashCode();
		hash = hash * prime + this.idModule.hashCode();
		
		return hash;
	}
}